package com.example.day03_mvp;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.util.AttributeSet;
import android.view.View;

public class MyAnimView extends View {
    private Point curPoint;
    private Paint mPaint;
    public MyAnimView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mPaint=new Paint(Paint.ANTI_ALIAS_FLAG);
        mPaint.setColor(Color.RED);
    }

    @SuppressLint("DrawAllocation")
    @Override
    protected void onDraw(Canvas canvas) {
        if (curPoint==null){
            curPoint = new Point(50,50);
            drawCircle(canvas);
        }
    }
    private void drawCircle(Canvas canvas){
        canvas.drawCircle(50,50,50f,mPaint);
    }
}
